//
//  GroupItemsCollectionViewCell.m
//  Findif
//
//  Created by Mac on 2019/2/21.
//  Copyright © 2019年 Cicel Chen. All rights reserved.
//

#import "GroupItemsCollectionViewCell.h"

@interface GroupItemsCollectionViewCell ()

@property (nonatomic, weak)UIImageView * iconImageView;
@property (nonatomic, weak)UILabel * nameLabel;

@end

@implementation GroupItemsCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        //设置控件
        [self setupUI];
    }
    
    return self;
}


- (void)setupUI{
    
    UIImageView * iconImageView = [UIImageView new];
    
    iconImageView.backgroundColor = [UIColor lightGrayColor];
    iconImageView.layer.cornerRadius = 25 * SCREENH6;
    iconImageView.layer.masksToBounds = YES;
    
    self.iconImageView = iconImageView;
    
    [self.contentView addSubview:self.iconImageView];
    
    
    UILabel * nameLabel = [UILabel new];
    
    nameLabel.textColor = [UIColor lightGrayColor];
    nameLabel.font = [UIFont systemFontOfSize:14 * SCREENH6];
    nameLabel.textAlignment = NSTextAlignmentCenter;
    nameLabel.text = @"aaaa";
    
    self.nameLabel = nameLabel;
    
    [self.contentView addSubview:self.nameLabel];
}


- (void)layoutSubviews{
    
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.contentView);
        make.top.mas_equalTo(self.contentView).offset(5 * SCREENH6);
        make.width.height.mas_equalTo(50 * SCREENH6);
    }];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.iconImageView);
        make.top.mas_equalTo(self.iconImageView.mas_bottom).offset(10 * SCREENH6);
        make.width.mas_equalTo(50 * SCREENH6);
    }];
}

@end
